from Base import message, intersect, SS_VALID
from DRG import MDCG_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["44.4402","34.0200x001","40.5900x013","40.5900x015","42.9200x007","42.9201","43.0x00x003","43.0x01","43.0x02","43.0x03","43.1900x003","43.1900x005","43.1900x006","43.4900","43.8200","43.8201","44.0000","44.0001","44.0100","44.0200","44.0200x002","44.0300x001","44.1500","44.3100","44.4000","44.4100x008","44.4101","44.4102","44.4200x001","44.4200x003","44.4201","44.4202","44.4400x005","44.4401","44.4403","44.4901","44.4902","44.5x00x002","44.5x00x004","44.5x00x005","44.5x01","44.6100x003","44.6200","44.6300x001","44.6301","44.6302","44.6400","44.6401","44.6701","44.6800x002","44.6801","44.6901","44.6902","44.9100x001","44.9100x005","44.9101","44.9201","44.9501","44.9502","44.9601","44.9602","44.9701","44.9801","44.9802","45.0100x005","45.0100x006","45.0101","45.0102","45.3101","45.3102","45.3200x001","45.6202","46.0101","46.7100","46.7200","46.7900x009","46.7902"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合GC2入组条件，匹配规则：主手术匹配')

    if MDCG_DRG.GC21_group(record):
      return 'GC21'

    if MDCG_DRG.GC23_group(record):
      return 'GC23'

    if MDCG_DRG.GC25_group(record):
      return 'GC25'
        
    return 'GC2'
  else:
    return ''
    
